package cn.itsource.rpms.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;

import java.sql.Timestamp;
import java.util.Date;

public class Part {
    //id
    private Long id;
    //配件名称
    private String part_name;
    //配件价格
    private BigDecimal price;
    //配件数量
    private Long num;
    //配件预警数
    private Long warn_num;
    //入库描述
    private String context;
    //配件入库时间
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date create_time = new Date();

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getPart_name() {
        return part_name;
    }

    public void setPart_name(String part_name) {
        this.part_name = part_name;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Long getNum() {
        return num;
    }

    public void setNum(Long num) {
        this.num = num;
    }

    public Long getWarn_num() {
        return warn_num;
    }

    public void setWarn_num(Long warn_num) {
        this.warn_num = warn_num;
    }

    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }
    @JsonFormat(pattern="yyyy-MM-dd",timezone ="GMT+8")
    public Date getCreate_time() {
        return create_time;
    }
    @DateTimeFormat(pattern="yyyy-MM-dd")
    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }

    @Override
    public String toString() {
        return "Part{" +
                "id=" + id +
                ", part_name='" + part_name + '\'' +
                ", price=" + price +
                ", num=" + num +
                ", warn_num=" + warn_num +
                ", context='" + context + '\'' +
                ", create_time=" + create_time +
                '}';
    }
}
